﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Windows;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace VectorPicsEditor
{
    public partial class ZoomWindow : Form
    {
        private Page currentPage;
        private Size size;

        public ZoomWindow(ref Page pg)
        {
            InitializeComponent();
            currentPage = pg;
            size = pg.GetCanvasSize();
        }

        private void okButton_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void trackBar1_Scroll(object sender, EventArgs e)
        {
            switch(trackBar1.Value)
            {
                case 0: //0x
                    currentPage.SetCanvasSize(size.Width, size.Height);
                    break;
                case 1: //2x
                    currentPage.SetCanvasSize(size.Width*2.0,size.Height*2.0);
                    break;
                case 2: //3x
                    currentPage.SetCanvasSize(size.Width*3.0,size.Height*3.0);
                    break;
                case 3: //4x
                    currentPage.SetCanvasSize(size.Width * 4.0, size.Height * 4.0);
                    break;
                case 4: //6x
                    currentPage.SetCanvasSize(size.Width * 6.0, size.Height * 6.0);
                    break;
                case -1: //-2x
                    currentPage.SetCanvasSize(size.Width / 2.0, size.Height / 2.0);
                    break;
                case -2: //-3x
                    currentPage.SetCanvasSize(size.Width / 3.0, size.Height / 3.0);
                    break;
                case -3: //-4x
                    currentPage.SetCanvasSize(size.Width / 4.0, size.Height / 4.0);
                    break;
                case -4: //-6x
                    currentPage.SetCanvasSize(size.Width / 6.0, size.Height / 6.0);
                    break;
            }
        }
    }
}
